package com.spzx.order.service.impl;

import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spzx.common.core.utils.DateUtils;
import com.spzx.common.security.utils.SecurityUtils;
import com.spzx.order.domain.OrderInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spzx.order.mapper.OrderLogMapper;
import com.spzx.order.domain.OrderLog;
import com.spzx.order.service.IOrderLogService;

/**
 * 订单操作日志记录Service业务层处理
 *
 * @author atguigu
 * @date 2024-07-03
 */
@Service
public class OrderLogServiceImpl extends ServiceImpl<OrderLogMapper, OrderLog> implements IOrderLogService
{
    @Autowired
    private OrderLogMapper orderLogMapper;

//
//    /**
//     * 查询订单操作日志记录列表
//     *
//     * @param orderLog 订单操作日志记录
//     * @return 订单操作日志记录
//     */
//    @Override
//    public List<OrderLog> selectOrderLogList(OrderLog orderLog)
//    {
//        return orderLogMapper.selectOrderLogList(orderLog);
//    }

    @Override
    public void saveLogAsync(OrderInfo orderInfo) {
        OrderLog orderLog = new OrderLog();
        orderLog.setOrderId(orderInfo.getId());
        orderLog.setOperateUser(SecurityUtils.getUsername());
        orderLog.setProcessStatus(orderInfo.getOrderStatus());
        orderLog.setNote("提交订单");
        this.save(orderLog);

    }
}
